#ifndef FILETRANSFERITEM_H
#define FILETRANSFERITEM_H

#include <QWidget>
#include "../Biz/MsgBusParam/IMFileTransferParam.h"

using namespace wwbiz;

namespace Ui {
    class FileTransferItem;
}

class FileTransferItem : public QWidget
{
    Q_OBJECT

public:
    explicit FileTransferItem(QWidget *parent = 0);
    ~FileTransferItem();
    void InitFileTransferData(FileTransferNotify data);

    void ProcessTransferNotify(FileTransferNotify notifydata);

    std::string GetFileName();
    bool IsSender();
    bool IsValid();

signals:
    void notifyOtherSide(FileTransferNotify);
    void transferProcessChanged(int);
    void newactivity();

private slots:
    void OnSaveFile();
    void OnCancel();
    void OnReject();
    void OnRetry();
    void on_btnOpen_clicked();

private:

    void ChangeTransferingProcess(int percent);
    void ChangeTransferEvent(int event);
    void SetTransferErrorInfo(int errcode);
    Ui::FileTransferItem *ui;
    FileTransferNotify  m_saved_data;
    bool m_session_valid;
};

#endif // FILETRANSFERITEM_H
